<?php
	session_start();
	require_once("banco.php");
	if(isset($_SESSION['idusuario'])) {
		//lista do usuario
		$result = mysql_query("select v.videoId,v.titulo from videos v, pref_video p where p.videoId=v.videoId and p.lista=1 and p.idusuario=" . addslashes($_SESSION['idusuario']) . " ORDER BY RAND()");
	}else{
		//Qualquer coisa
		$result = mysql_query("select v.videoId,v.titulo from videos v, pref_video p where p.videoId=v.videoId and p.lista=1 ORDER BY RAND()");
	}
?>
<?                                                                                            
include("data.php");
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>Vinil de Queijo</title>
	<link href="default.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="swfobject.js"></script>
	<script type="text/javascript" src="queijotube.js"></script>
	<script type="text/javascript">
	var lista = [<?php
		if($obj = mysql_fetch_object($result)){
			echo '{videoId: "' . $obj->videoId . '",titulo:"' . addslashes($obj->titulo) . '"}';
		}
		while ($obj = mysql_fetch_object($result)){
			echo ',{videoId: "' . $obj->videoId . '",titulo:"' . addslashes($obj->titulo) . '"}';
		}
	?>];
	</script>
	<style>
		#ytapiplayer{
			width: 50%;
		}
		#frmLogin{

		}
		#frmCadastro,
		#frmLogin,
		#playList{
			width: 50%;
		}
		#playList{
			position: absolute;
			right: 5px;
			top: 4px;
		}
	</style>
</head>
<body>
<div id="header">
	<div id="logo">
		<h1><a href="#">Vinil de Queijo</a></h1>
		<h2><a href="#">Music Store</a></h2>
	</div>
	<div id="menu">
		<ul>
			<li class="active"><a href="#" title="">Principal</a></li>
			<li><a href="#" title="">Sobre</a></li>
			<li><a href="#" title="">Produtos</a></li>
			<li><a href="#" title="">Usuários</a></li>
			<li><a href="#" title="">Suporte</a></li>
		</ul>
	</div>
</div>
<div id="wrapper">
	<div id="content">
		<div id="sidebar">
			<div id="support">
				<h2>Suporte</h2>
				<h3>(21)9999-9999</h3>
			</div>
			<div id="login" class="boxed">
				<h2 class="title">Entrar</h2>
				<div class="content">
					<form action="login.php" id="frmLogin" onsubmit="return login(this)">
						<fieldset>
						<legend>Entrar</legend>
						<label for="email">Email:</label>
						<input id="inputtext1" type="text" id="email" name="email" />
						<label for="senha">Senha:</label>
						<input id="inputtext2" type="password" id="senha" name="senha" />
						<input id="inputsubmit1" type="submit" name="inputsubmit1" value="Entrar" />
						<p><a href="#">Esqueceu sua senha?</a></p>
						</fieldset>
					</form>
				</div>
				<h2 class="title">Cadastro de Usu&aacute;rio</h2>
				<div class="content">
					<form id="form1" method="post" action="#">
						<fieldset>
						<legend>Cadastrar Usu&aacute;rio</legend>
						<label for="nome">Nome:</label>
						<input id="inputtext1" type="text" id="nome" name="nome" />
						<label for="email">Email:</label>
						<input id="inputtext1" type="text" id="email" name="email" />
						<label for="senha">Senha:</label>
						<input id="inputtext2" type="password" id="senha" name="senha" />
						<label for="confSenha">Confirme a senha:</label>
						<input id="inputtext2" type="password" id="confSenha" name="confSenha" />
						<input id="inputsubmit1" type="submit" name="inputsubmit1" value="Registrar" />
						</fieldset>
					</form>
				</div>
			</div>
			<div id="updates" class="boxed">
				<h2 class="title">Novidades</h2>
				<div class="content">
					<ul>
						<li>
							<h3>7 de Maio, 2010</h3>
							<p><a href="#">Novo template do Vinil de Queijo</a></p>
						</li>
						<li>
							<h3>15 de Abril, 2010</h3>
							<p><a href="#">Vinil de Queijo é colocado no ar!</a></p>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<div id="main">
			<div id="welcome" class="post">
				<h2 class="title">Bem-vindo ao Vinil de Queijo</h2>
				<h3 class="date"><span class="month">Mar.</span> <span class="day">8</span><span class="year">, 2007</span></h3>
				<div class="meta">
					<p>Vinil de Queijo</p>
				</div>
				<div class="story">
					<div id="ytapiplayer">
						You need Flash player 8+ and JavaScript enabled to view this video.
					</div>
				</div>
			</div>
			<h2 class="title">Cadastrar V&iacute;deo</h2>
				<div class="cadastrarVideo">
					<form action="incluirVideo.php" id="frmIncluirVideo" onsubmit="return cadastrar(this)">
						<fieldset>
						<legend>Cadastrar V&iacute;deo</legend>
						<label for="youtubeId">URL do V&iacute;deo:</label>
						<input id="inputtext1" type="text" id="youtubeId" name="youtubeUrl" />
						<input id="inputsubmit1" type="submit" name="inputsubmit1" value="Cadastrar" />
						</fieldset>
					</form>
				</div>
		
			<div id="example" class="post">
				<h2 class="title">PlayList</h2>
				<h3 class="date"><span class="month">Feb.</span> <span class="day">24</span><span class="year">, 2007</span></h3>
				<div class="meta">
					<p>Lista de Reprodução</p>
				</div>
				<div class="story">
					<a href="javascript: proximo()">Pr&oacute;ximo</a>
					<ol id="lista"></ol>
				</div>
			</div>
		</div>
	</div>
	<div style="clear: both;">&nbsp;</div>
</div>
<div id="footer">
	<p id="legal">Copyright &copy; 2010 Vinil de Queijo. Todos os Direitos Reservados.</p>
	<p id="links"><a href="#">Política de Privacidade</a> | <a href="#">Termos de Uso</a></p>
</div>

<div style="font-size: 0.8em; text-align: center; margin-top: 1.0em; margin-bottom: 1.0em;">
Music Store <a href="http://www.freewebtemplates.com/">Vinil de Queijo</a> - O seu site de musica!
</div>
</body>
</html>
